package com.lanou3g.farmdoctor.fragment;

import android.graphics.Color;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v7.widget.Toolbar;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.LinearLayout;
import android.widget.RelativeLayout;
import android.widget.TextView;
import android.widget.Toast;

import com.lanou3g.farmdoctor.R;
import com.lanou3g.farmdoctor.base.BaseFragment;

import de.hdodenhof.circleimageview.CircleImageView;


/**
 * 本类由: Risky 创建于: 15/11/24.
 */
public class OwnFragment extends BaseFragment implements View.OnClickListener {

    private TextView tvTitle;
    private RelativeLayout forGoldRe;// 绑定手机
    private CircleImageView userImageIv;// 用户头像，进入名片界面
    private TextView goldRuleTv; // 金币规则，进入规则介绍界面
    private LinearLayout acceptLinear, agreeLinear, comeLinear;// 3种问题界面
    private LinearLayout layout1, layout2, layout3, layout4;// 临时使用

    @Nullable
    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
        return inflater.inflate(R.layout.fragment_own, null);
    }

    @Override
    public void onActivityCreated(@Nullable Bundle savedInstanceState) {
        super.onActivityCreated(savedInstanceState);
        initView(getView());
    }

    private void initView(View v) {
        tvTitle = (TextView) v.findViewById(R.id.tv_middle);
        tvTitle.setText("我");

        forGoldRe = (RelativeLayout) v.findViewById(R.id.own_make_gold);
        userImageIv = (CircleImageView) v.findViewById(R.id.own_user_image);
        goldRuleTv = (TextView) v.findViewById(R.id.own_gold_rule);
        acceptLinear = (LinearLayout) v.findViewById(R.id.own_accept);
        agreeLinear = (LinearLayout) v.findViewById(R.id.own_agree);
        comeLinear = (LinearLayout) v.findViewById(R.id.own_come_for_name);

        layout1 = (LinearLayout) v.findViewById(R.id.own_person_info_layout);
        layout2 = (LinearLayout) v.findViewById(R.id.own_question_layout);
        layout3 = (LinearLayout) v.findViewById(R.id.own_collect_layout);
        layout4 = (LinearLayout) v.findViewById(R.id.own_other_layout);

        forGoldRe.setOnClickListener(this);
        userImageIv.setOnClickListener(this);
        goldRuleTv.setOnClickListener(this);
        acceptLinear.setOnClickListener(this);
        agreeLinear.setOnClickListener(this);
        comeLinear.setOnClickListener(this);

        layout4.setOnClickListener(this);
        layout3.setOnClickListener(this);
        layout2.setOnClickListener(this);
        layout1.setOnClickListener(this);
    }

    @Override
    public void onClick(View v) {
        switch (v.getId()) {
            case R.id.own_make_gold:
                Toast.makeText(getActivity(), "功能未开启！", Toast.LENGTH_SHORT).show();
                break;
            case R.id.own_user_image:
                Toast.makeText(getActivity(), "功能未开启！", Toast.LENGTH_SHORT).show();
                break;
            case R.id.own_gold_rule:
                Toast.makeText(getActivity(), "功能未开启！", Toast.LENGTH_SHORT).show();
                break;
            case R.id.own_accept:
                Toast.makeText(getActivity(), "功能未开启！", Toast.LENGTH_SHORT).show();
                break;
            case R.id.own_agree:
                Toast.makeText(getActivity(), "功能未开启！", Toast.LENGTH_SHORT).show();
                break;
            case R.id.own_come_for_name:
                Toast.makeText(getActivity(), "功能未开启！", Toast.LENGTH_SHORT).show();
                break;
            case R.id.own_person_info_layout:
                Toast.makeText(getActivity(), "功能未开启！", Toast.LENGTH_SHORT).show();
                break;
            case R.id.own_question_layout:
                Toast.makeText(getActivity(), "功能未开启！", Toast.LENGTH_SHORT).show();
                break;
            case R.id.own_collect_layout:
                Toast.makeText(getActivity(), "功能未开启！", Toast.LENGTH_SHORT).show();
                break;
            case R.id.own_other_layout:
                Toast.makeText(getActivity(), "功能未开启！", Toast.LENGTH_SHORT).show();
                break;
        }
    }
}
